package vmcs.simulationsystem;

import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import vmcs.controller.TransactionController;

public class DrinkSelectionListener implements ActionListener{

	private TransactionController transactionController;
	
	public DrinkSelectionListener (TransactionController transactionController){
		this.transactionController = transactionController;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		   String cmd;
           int idx;
           Button btn;

           btn = (Button) e.getSource();
           cmd = btn.getActionCommand();
           idx = Integer.parseInt(cmd);
           
           transactionController.startTransaction(idx);
		
	}

}
